<?php
class MyWebApplication extends WebApplication {
	public function __construct($root_dir, $template_dir = 'templates') {
		parent::__construct($root_dir, $template_dir);
	}
    
	public function getDomain()
	{
		return 'http://'.getenv('SERVER_NAME').'/wen';
	}

	protected function initRouter() {
		$router = new Router();
        
		NamedRouterRule::create()
			->controller('index/index')
			->domain_url($this->getDomain(), '/')
			->addto($router);    
		/*            
		NamedRouterRule::create()
			->controller('<controller>/index')
			->domain_url($this->getDomain(), '/<controller>/')
			->addto($router);
		*/
		FixedRouterRule::create()
			->domain($this->getDomain())
			->url('/<controller>/<action>')
			->addto($router);
		return $router;
	}
    
	protected function initInterceptors() {
		$this->interceptors['default'] = array();
	}
}
?>
